#include<iostream>
#include<algorithm>
using namespace std;
int n;
int w,score;


int main(){
    cin>>n;
    int sum = 0;
    for(int i=1;i<=n;i++){
        cin>>w>>score;
        sum+=w*score;
    }
    cout<<max(sum,0)<<endl;
    //system("pause");
}